@extends('default.layouts.adminPublic')
@section('title', '修改地区分站')
@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/admin/indexList.css')}}">
    @endsection
    @section('content')
            <!--导航开始-->
    <div class="crumb_warp">
        <i class="fa fa-home"></i> <a href="{{url('admin/area_station')}}">首页</a> &raquo; 地区分站列表
    </div>
    <!--导航结束-->
    <!--结果集标题与导航组件 开始-->
    <div class="con">

        <div class="conMain">
            <div class="result_wrap">
                <div class="search">
                    <span style="margin-right: 20px;"><a href="{{url('admin/area_station/create')}}"><i
                                    class="fa fa-plus"></i>添加地区分站</a></span>
                    <span><a href="{{url('admin/area_station')}}"><i class="fa fa-recycle"></i>地区分站列表</a></span>
                </div>
                <div class="message"><h2>修改地区分站</h2></div>
            </div>
            <div class="conInfo">
                <div class="manage" style="padding: 0; margin-bottom: 10px;">
                    @if(count($errors)>0)
                        <div class="mark">
                            @if(is_object($errors))
                                @foreach($errors->all() as $error)
                                    <p>{{$error}}</p>
                                @endforeach
                            @else
                                <p>{{$errors}}</p>
                            @endif
                        </div>
                    @endif
                </div>
                <div class="conAddList">
                    <form action="{{url('admin/area_station/'.$area_station->id)}}" onsubmit="return checkForm('#stationForm')" method="post" name="stationForm"
                          id="stationForm">
                        <input type="hidden" name="_method" value="put">
                        <input type="hidden" name="id" value="{{$area_station->id}}">
                        {{csrf_field()}}
                        <dl>
                            <dt><i class="require">*</i>分站子域名：</dt>
                            <dd><input type="text" class="inpText" value="{{$area_station->station_domain}}"
                                       name="station_domain" id="station_domain"></dd>
                        </dl>
                        <dl>
                            <dt><i class="require">*</i>分站地区标识：</dt>
                            <dd><input type="text" class="inpText" value="{{$area_station->station_sign}}"
                                       name="station_sign"
                                       id="station_sign"></dd>
                        </dl>
                        <dl>
                            <dt><i class="require">*</i>分站地区名称：</dt>
                            <dd><input type="text" class="inpText" value="{{$area_station->station_name}}"
                                       name="station_name"
                                       id="station_name"></dd>
                        </dl>
                        <dl>
                            <dt><i class="require">*</i>分站标题：</dt>
                            <dd><input type="text" class="inpText" style="width:700px;"
                                       value="{{$area_station->station_title}}"
                                       name="station_title" id="station_title"></dd>
                        </dl>
                        <dl>
                            <dt><i class="require">*</i>分站地区编号：</dt>
                            <dd style="margin-top: 4px">
                                <input id="station_cid" name="station_cid" type="hidden" value="{{$area_station->station_cid}}" >
                                <input id="province" name="province" type="hidden" >
                                <div id="province_select" class="select"  ><span><a></a></span><i></i></div>
                                <input id="area" name="area" type="hidden">
                                <div id="area_select" class="select" style="margin-left: 5px;" ><span><a></a></span><i></i></div>
                                <input id="city" name="city" type="hidden" value="">
                                <div id="city_select" class="select" style="margin-left: 5px;"><span><a></a></span><i></i></div>
                            </dd>
                        </dl>
                        <dl>
                            <dt><i class="require">*</i>分站关键词：</dt>
                            <dd><input type="text" class="inpText" style="width:700px;"
                                       value="{{$area_station->station_keyword}}" name="station_keyword"
                                       id="station_keyword"></dd>
                        </dl>
                        <dl style="height: 100px;">
                            <dt style="height: 100px;"><i class="require">*</i>分站描述：</dt>
                            <dd style="height: 100px;"><textarea name="station_description" id="station_description"
                                                                 style="height: 68px; width:525px;">{{$area_station->station_description}}</textarea>
                            </dd>
                        </dl>
                        <dl>
                            <dt>分站排序：</dt>
                            <dd><input type="text" style="width: 140px;" class="inpText"
                                       value="{{$area_station->station_sort}}" name="station_sort" id="station_sort">
                            </dd>
                        </dl>
                        <dl>
                            <dt></dt>
                            <dd>
                                <input type="submit" class="sub" value="修改分站">
                                <input type="button" class="sub but" onclick="history.go(-1)" value="返回列表">
                            </dd>
                        </dl>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
@parent
        <!--地区三级联动-->
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.select.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.select.area.js')}}"></script>
    <script type="text/javascript">
        var stationForm = $("#stationForm");
        $(function(){
            //地区联动
            stationForm.find("#station_cid").selectArea({
                'province':$('#province'),
                'area':$('#area'),
                'city':$('#city'),
                selected:'{{$area_station->station_cid}}'
            });
        });
    </script>
@endsection
